#pragma once
#include "matrix.h"
#include "vector3.h"

using namespace krryn::math;

namespace krryn{
namespace system{
	class input;
}
namespace view{
	class camera{
	public:
		camera(const math::vector3f &a_Up, const math::vector3f &a_Target, const math::vector3f &a_Pos)
			: m_Up(a_Up), m_Target(a_Target), m_Position(a_Pos) {}

		virtual void update(float a_DeltaTime) = 0;
		virtual void update_mouse(int a_SceenWidth, int a_SceenHeight) = 0;

		math::vector3f m_Up, m_Target, m_Position;
	};

	class camera_fps : public camera{
	public:
		camera_fps(
			system::input *a_Input, const math::vector3f &a_Up, 
			const math::vector3f &a_Target, const math::vector3f &a_Pos);

		void update(float a_DeltaTime);
		void update_mouse(int a_SceenWidth, int a_SceenHeight);
	private:
		system::input *m_Input;

		math::matrix get_look_at_matrix();

		// negative speed moves backwards
		void move(float a_Speed);
		void strafe(float a_Speed);
		void rotate(float a_Speed);
	};
}
}
